using System;
using System.Windows.Forms;

using FreeFlow.Administration;

namespace FreeFlowAdministrator
{
	/// <summary>
	/// Summary description for ScriptAdaptor.
	/// </summary>
	public class ScriptAdaptor : Adaptor, IRefreshable
	{
    private Script script;
		public ScriptAdaptor(Script script)
		{
      this.script = script;
		}

    public override string Text
    {
      get
      {
        return script.Name;
      }
    }

    public override object Object
    {
      get
      {
        return script;
      }
    }

    public override int ImageIndex
    {
      get
      {
        return 31;
      }
    }

    public override Control GetRenderer()
    {
      ScriptControl control = new ScriptControl();
      control.LoadScript(script);
      return control;
    }

    #region IRefreshable Members

    public void Refresh()
    {
      script.Refresh();
    }

    #endregion
  }
}
